Skip to content

Dispatchers: remove selectors, which nothing calls - #4635

Merged
alex merged 2 commits into
mainfrom
claude/charming-archimedes-aj5193-no-selectors
Nov 8, 2026
Merged

alex merged 2 commits into
mainfrom
claude/charming-archimedes-aj5193-no-selectors

Conversation

@alex

@alex alex commented Nov 8, 2026 •

Copy link
Copy Markdown
Member

Stacked on #4629 (itself on #4623); only the top commit is this PR's.

Selectors (<function>_select, VG.Rust.selector) returned the implementation a dispatcher would run, so that Rust code could choose once and call it without choosing again; VG.Dispatch.selected listed which functions got one. Their only caller was AES-GCM, which calls the dispatchers since #4629, and since #4623 the dispatchers choose once themselves. So this deletes them:

  • TCB/Rust.lean: Selected, selectName, selector, their documentation, and the selected parameters of dispatchers and files with the check that each named function has a dispatcher.
  • TCB/Emit.lean: the selected argument of run, and VG.Dispatch.selected in the driver's main and #assert_no_compiler_overrides.
  • Dispatch.lean: selected.
  • VerifiedGarbageTest/Dispatch.lean: the selector tests.
  • The generated _select functions (−1,156 lines across the x86-64, AArch64, x86, ARM, POWER and RISC-V crates).

Trust change

Removal only: the trusted printer loses a function and the emitter an input. No dispatcher's text changes, and nothing else in the generated crates does.

It also unblocks EmitOne.lean on x86-64 and AArch64 registration files, which stopped at vg_aes_gcm_…: has a selector (VG.Dispatch.selected) but no dispatcher, since it sees only one file's artifacts. With this, EmitOne --check Rc2.AArch64 passes; Md5.X86_64 and Poly1305.AArch64 still report their module file out of date, for a reason unrelated to these PRs (run alone, EmitOne leaves out the #[path = "internal/…"] mod …; declarations the full emitter writes; the files are the same as main's).

Testing

  • lake build +VerifiedGarbageTest.Dispatch, lake env lean --run Emit.lean, the static-checks job's steps, and ci/check_lean_public_imports.py on the edited modules.
  • cargo clippy --all-targets -D warnings for x86-64, aarch64 (Linux, Apple), i686, armv7, riscv64 and powerpc64le; cargo test --release with Wycheproof on x86-64.

No benchmark: nothing called the removed functions, so no code that runs changes.

🤖 Generated with Claude Code

https://claude.ai/code/session_01TKUFHFCSTvQuX83u32Ae29

@alex
alex force-pushed the claude/charming-archimedes-aj5193-aes-gcm branch from 28bd86f to 1ee0a6e Compare November 8, 2026 14:38
@alex
alex force-pushed the claude/charming-archimedes-aj5193-no-selectors branch from 4478e43 to 305ec33 Compare November 8, 2026 14:38
@alex
alex force-pushed the claude/charming-archimedes-aj5193-no-selectors branch from 480c7dc to ac5f643 Compare November 8, 2026 15:05
@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown

This pull request has conflicts with claude/charming-archimedes-aj5193-aes-gcm, found after 8fbfb47 landed on main: rebase it to resolve them. Before rebasing, see CLAUDE.md on checking how much Lean main changed, and on restacking a stacked pull request.

Posted by .github/workflows/conflicts.yml, once per push to a conflicting pull request.

Base automatically changed from claude/charming-archimedes-aj5193-aes-gcm to main November 8, 2026 15:07
A selector (`<function>_select`, `VG.Rust.selector`) returned the
implementation a dispatcher would run, for the Rust code to choose once
and call without choosing again; `VG.Dispatch.selected` listed the
functions that got one. AES-GCM, their only caller, now calls the
dispatchers, which choose once themselves. This removes the selectors
from the trusted printer (`Rust.selector`, `Rust.Selected`), the emitter
(`files`, `run` and the driver's `#assert_no_compiler_overrides`), the
list in `Dispatch.lean`, their tests, and the generated `_select`
functions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TKUFHFCSTvQuX83u32Ae29
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TKUFHFCSTvQuX83u32Ae29
@alex
alex force-pushed the claude/charming-archimedes-aj5193-no-selectors branch from ac5f643 to 429fb1d Compare November 8, 2026 15:12
@alex
alex enabled auto-merge November 8, 2026 15:14
@alex
alex added this pull request to the merge queue Nov 8, 2026
Merged via the queue into main with commit 4ef8581 Nov 8, 2026
41 checks passed
@alex
alex deleted the claude/charming-archimedes-aj5193-no-selectors branch November 8, 2026 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants